<?php

defined('_JEXEC') or die('Restricted access');

if (!class_exists('VmConfig'))
	require(JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'config.php');
//VmConfig::loadConfig();
vmJsApi::jQuery();
vmJsApi::jSite();
// check for permission Only vendor and Admin can use VM2 BE
// this makes trouble somehow, we need to check if the perm object works not too strict maybe
if (!class_exists('Permissions'))
	require(JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php');
if (!Permissions::getInstance()->isSuperVendor()) {
	$app = JFactory::getApplication();
	vmError('Access restricted to Vendor and Administrator only (you are admin and should not see this messsage?)', 'Access restricted to Vendors and Administrator only');
	$app->redirect('index.php');
}
require_once(JPATH_COMPONENT.DS.'controller.php');
//echo JPATH_COMPONENT.DS.'controller.php';
// tao controller
$control = new svController();
//$control->test();
//$control->execute(JRequest::getVar('task')); // cau lenh thuc hien view ma ta chi dinh
// sau cau lenh tren new task='' joomla se tim den cotroller.php va thuc hien function display()
$control->execute(JRequest::getVar('task'));
?>